AddCSLuaFile('custom.lua')

registerFunction("give", "e:s", "", function(self,args)
	local op1, op2 = args[2], args[3]
	local rv1, rv2 = op1[1](self, op1), op2[1](self, op2)
	if (!rv1:IsPlayer()) then return end
	if (!self.player:IsAdmin()) then return nil end
	rv1:Give(rv2)
end)

registerFunction("giveAmmo", "e:ns", "", function(self,args)
	local op1, op2, op3 = args[2], args[3], args[4]
	local rv1, rv2, rv3 = op1[1](self, op1), op2[1](self, op2), op3[1](self, op3)
	if (!rv1:IsPlayer()) then return end
	if (!self.player:IsAdmin()) then return nil end
	rv1:GiveAmmo(rv2,rv3)
end) 